using TMPro;
using UnityEngine;

public class UiSkillTooltip : UiTooltip
{
    private TextMeshProUGUI skillDescription;
    private TextMeshProUGUI skillName;
    private TextMeshProUGUI cost;
    private float defaultFontSize;

    private void Awake()
    {
        skillDescription = transform.Find("Description").GetComponent<TextMeshProUGUI>();
        skillName = transform.Find("Name").GetComponent<TextMeshProUGUI>();
        cost = transform.Find("Cost").GetComponent<TextMeshProUGUI>();
        defaultFontSize = skillName.fontSize;
    }

    public void Show(string description, string skillName, int cost)
    {
        this.skillName.text = skillName;
        skillDescription.text = description;
        this.cost.text = $"Cost: {cost}";
        AdjustPosition();
        // AdjustFontSize(this.skillName);
        gameObject.SetActive(true);
    }

    public void Hide()
    {
        gameObject.SetActive(false);
        // skillName.fontSize = defaultFontSize;
    }
}